#include"Globals.h"

//everything equals the float
XYZ XYZ::operator=(float right)
{
	XYZ temp;
	temp.x=temp.y=temp.z=right;
	return temp;
}

bool XYZ::compare(XYZ right)
{
	XYZ temp={x,y,z};
	if(temp >right)
		return true;
	return false;
}
//divides the n
XYZ XYZ::operator/(float n)
{
	XYZ temp;
	temp.x=x/n;
	temp.y=y/n;
	temp.z=z/n;
	return temp;
}

//determines how it is greater base on middle of board
//map dont know what went wrong 
//bool operator<(XYZ left,XYZ right)
//{
//	//dont know how to do this without pointer
//	//XYZ temp={x,y,z};
//	//return true if all points are greater else return false
//	if(left.compare(right) <0) 
//	return true;
//
//	return false;
//}

bool XYZ::operator<(XYZ right)
{
	//dont know how to do this without pointer
	//XYZ temp={x,y,z};
	//return true if all points are greater else return false
	if(x<right.x && y<right.y && z <right.z) 
	return true;

	return false;
}
//determines how it is greater base on middle of board
bool XYZ::operator>(XYZ right)
{
	//dont know how to do this without pointer
	XYZ temp={x,y,z};
	//return true if all points are greater else return false
	if(x>right.x && y>right.y && z >right.z) 
	return true;
	return false;
}
//determines how it is greater base on middle of board
bool XYZ::operator>=(XYZ right)
{
	//dont know how to do this without pointer
	XYZ temp={x,y,z};
	//return true if all points are greater else return false
	if(x>=right.x && y>=right.y && z >=right.z) 
	return true;
	return false;
}
//dont neeedd or wrong use
bool XYZ::operator!=(char w)
{
	XYZ right={-63.0f,5.0f,-12.0f};
	switch(w)
	{
	case 'd':
		{
			//dont go in water
			XYZ right={-63.0f,5.0f,-12.0f};
			
			if(x == right.x &&y== right.y &&z == right.z )
				return false;
			break; // dont need
		} 
	case 'w':
		{
			//dont go in water
			XYZ right={-45.0f,5.0f,-30.0f};
			if(x == right.x &&y== right.y &&z == right.z)
				return false;
			break; // dont need
		} 
	}
	return true;
}
// adds
XYZ XYZ:: operator+(XYZ right)
{
	XYZ temp;
	temp.x=x+right.x;
	temp.y=y +right.y;
	temp.z=z +right.z;
	return temp;

}

XYZ XYZ:: operator-(XYZ right)
{
	XYZ temp;
	temp.x=x-right.x;
	temp.y=y -right.y;
	temp.z=z -right.z;

	return temp;

}

XYZ XYZ:: operator*(XYZ right)
{
	XYZ temp;
	temp.x=x*right.x;
	temp.y=y *right.y;
	temp.z=z *right.z;

	return temp;

}

bool XYZ:: operator==(XYZ right)
{
	//checks if even returns true or false if not even
	if((x == right.x) && (y ==right.y) && (z ==right.z))
	return true;
	
	return false;

}


XYZ set(float x,float y,float z)
{
	 XYZ temp={x,y,z};
	 return temp;
}

